<?php

// phpMyRealty 3
//
// File Name: timings.php
// File Location : ./includes/
//
// Copyright (c)2009 phpMyRealty.com
//
// e-mail: support@phpMyRealty.com

if ($conf['timings'] == "ON") {
 $timing_stop = explode(' ', microtime());
 $timings = $timing_stop[0] - $timing_start[0];
 $timings+= $timing_stop[1] - $timing_start[1];
 $timings = round($timings, 5);

 if ( $conf['gzip'] == "ON" && ereg ( 'gzip', $SERVER_ENCODING ) && extension_loaded ( 'zlib' ) )
  $compression = '<strong>Gzip compression:</strong> Enabled';

 if ( $conf['gzip'] != "ON" && ereg ( 'gzip', $SERVER_ENCODING ) && extension_loaded ( 'zlib' ) )
  $compression = '<strong>Gzip compression:</strong> Disabled, Supported';

 if ( !ereg ( 'gzip', $SERVER_ENCODING ))
  $compression = '<strong>Gzip compression:</strong> Not Supported By Your Browser <small>(because of a firewall software or HTTP 1.1 not accepted)</small>';
   
 if ( !extension_loaded ( 'zlib' ) )
  $compression = '<strong>Gzip compression:</strong> Not Supported By Your Host <small>(ask your host administrator to install zlib extension for php)</small>';

 $gd = '<strong>GD Library:</strong> ';

 if ( !extension_loaded('gd') ) 
  $gd.= 'Not Installed';  
 else {
  if (gd_version() >= '2.0.28')
   $gd.= 'Installed, v.' . gd_version() . ' <small>(supports GIF)</small>';
  else
   $gd.= 'Installed, v.' . gd_version() . ' <small>(GIF support is unavailable)</small>';
 }

 echo '<span class="timings">Generated in <strong>' . $timings . '</strong> secs, <strong>' . $db->counter . '</strong> SQL queries executed in <strong>' . $db->timecounter . '</strong> secs <br />' . $gd . ' ' . $compression . '<br />';

 echo '</span>';

}

?>